<template>
  <div class="flex items-center gap-col-16px">
    <div class="w-126px">
      <el-select v-model="row.status" :disabled="disabled">
        <el-option :value="0" label="正常" />
        <el-option :value="1" label="异常" /> </el-select
    ></div>
    <template v-if="row.status === 1">
      <div class="flex items-center gap-col-6px">
        <span>处理方法</span>
        <el-select
          v-model="row.treatmentMethod"
          placeholder="请选择处理方法"
          :disabled="disabled"
          clearable
          class="!w-160px"
        >
          <el-option
            v-for="dict in getStrDictOptions(DICT_TYPE.SCHOOL_CLASS_ASSET_HANDLE)"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </div>

      <el-switch
        v-model="row.treatmentStatus"
        :disabled="disabled"
        inline-prompt
        active-text="已处理"
        inactive-text="未处理"
      />
    </template>
  </div>
</template>
<script setup lang="ts">
import { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
const props = defineProps<{
  data: any
  disabled?: boolean
}>()
const emit = defineEmits<{
  (e: 'update:data', val: any): void
}>()
const row = computed({
  get() {
    return props.data
  },
  set(val) {
    emit('update:data', val)
  }
})
</script>
<style lang="scss" scoped></style>
